<?php

namespace app\common\model;

class ShopOrderLogModel extends BaseModel
{
    protected $name = 'shop_order_log'; //定义用户表
    //开启自动写入时间戳
    protected $autoWriteTimestamp = false;
    // 定义自动完成的属性
    protected $auto = []; //新增修改
    protected $insert = []; //插入
    protected $update = []; //修改

    /**
     * 添加订单日志
     */
    public function addOrderLog($actionName, $orderId, $orderStatus, $shippingStatus, $payStatus, $logMsg)
    {
        $logData = [
            'order_id'        => $orderId,
            'order_status'    => $orderStatus,
            'shipping_status' => $shippingStatus,
            'pay_status'      => $payStatus,
            'log_msg'         => $logMsg,
            'action_name'     => $actionName,
            'log_time'        => time(),
        ];
        $this->addData($logData);
    }

}